#ifndef _CAR_PROTOCOL_MMS317_H
#define _CAR_PROTOCOL_MMS317_H

typedef struct mms317_packet_data{
    u8 FlagAA;
    u8 Flag55;
    u8 Length;
    u8 GroupID;
    u8 CommandID;
    char data[0];
    //u16 CRC; 2
}__attribute__((packet)) mms317_packet_t;

#define CN_MMS317_PACKET_HEAD_FLAGAA    0xAA
#define CN_MMS317_PACKET_HEAD_FLAG55    0x55

#define CN_MMS317_PACKET_HEAD_LENGTH            (sizeof(mms317_packet_t))
#define CN_MMS317_PACKET_UART_MIN_LENGTH        ( CN_MMS317_PACKET_HEAD_LENGTH + 1 )    /* 0x55 + len+gid+cid+crc(2) */
#define CN_MMS317_PACKET_UART_MAX_LENGTH        (255 + 2)
#defien CN_MMS317_PACKET_PROTOCOL_MIN_LENGTH    (CN_MMS317_PACKET_HEAD_LENGTH)  /* len+gid+cid+crc(2) */

class ProtocolMMS317 : public ProtocolBase{

private:
    int mms317_init();

    char mDivPacket[1024*3 + 40];
    int mPacketIndex = 0;
};
#endif /* _CAR_PROTOCOL_MMS317_H */
